#ifndef DEVICE_MUSIC_H
#define DEVICE_MUSIC_H

#include <QApplication>
#include <QMovie>
#include <QSoundEffect>
#include <QMediaPlayer>
#include <QMediaPlaylist>
#include "my_custom/global.h"
#include "my_custom/sliderbutton.h"


namespace Ui {
class DeviceMusic;
}

class DeviceMusic : public QWidget
{
    Q_OBJECT

public:
    explicit DeviceMusic(int room,QWidget *parent = nullptr);
    ~DeviceMusic();

    SliderButton* my_Slider_btn; // 滑动按钮对象指针
    int room_name; // 房间名称或编号
    QMovie *movie; //图片加载器
    QMediaPlayer *music_player; //音乐加载器
    QMediaPlaylist *music_player_list;

private:
    Ui::DeviceMusic *ui;

public slots:
    void music_slider_OFF(void); // 滑动按钮关断槽函数
    void music_slider_ON(void); // 滑动按钮开启槽函数
    void simulateMousePressMusic();//模拟按钮点击的效果
    void on_previous_clicked();
    void on_last_clicked();


signals:
    void sig_sendData(int sockID, QString sendData); // 发送数据信号，用于与外部通信
    void log_message(QString message);
    void update_foreground(bool isOpen);
    void positionChanged(qint64 position);


};
#endif // DEVICE_MUSIC_H
